package com.nuc.workflowserver.controller;

import com.nuc.workflowserver.model.pojo.Admin;
import com.nuc.workflowserver.service.IAdminService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin")
@Api(value = "查询admin接口", description = "提供页面的增删改查")
public class AdminController {

    @Autowired
    IAdminService iAdminService;

    @PostMapping("/selectList/{pageNum}/{pageSize}")
    @ApiOperation("分页查询admin列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageNum", value = "当前页码", required = true, paramType = "path", dataType = "int"),
            @ApiImplicitParam(name = "pageSize", value = "每页记录", required = true, paramType = "path", dataType = "int"), })
    public Object selectList(@PathVariable Integer pageNum,
            @PathVariable Integer pageSize) {

        return iAdminService.selectPage(new Admin(), pageNum, pageSize);
    }
}
